function [rate,k,accuracy]=test(data_fold_path,flag);
%test the accuracy of different k
%data_fold_path:flod path of data,like '../data/'
%rate:component for PCA
%k:dim of feature
%accuracy:2x16,the accuracy of LDF,QDF with differant rate
tic;
if flag
    rate=0.8:0.01:0.95;
else
    rate=0.82;
end

k=zeros(2,size(rate,2));
accuracy=zeros(2,size(rate,2));

%data_fold_path='../data/';
for i=1:size(rate,2)
    [omega,omega0,P,k(1,i)]=LDF_Classifier_train(data_fold_path,rate(1,i));
    accuracy(1,i)=LDF_Classifier_test(data_fold_path,omega,omega0,P);
    [Omega,omega,omega0,P,k(2,i)]=QDF_Classifier_train(data_fold_path,rate(1,i));
    accuracy(2,i)=QDF_Classifier_test(data_fold_path,Omega,omega,omega0,P);
    disp('loop:');
    disp(i);
end
disp(accuracy);
toc;
end